<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>代码模板功能演示</title>
</head>
<body>

	<h1>代码模板功能演示</h1>

	<p>
		<label>选择数据库表： </label> 
		<select id="tableName" onchange="change()">
			<!-- #for(table : tables) -->
			<option>${table.tableName}</option>
			<!-- #endfor -->
		</select>
		
		<span style="margin-left: 20px">
			<a href="#" onclick="go('model')">Model</a>
			<a href="#" onclick="go('form')">Form</a>
			<a href="#" onclick="go('iservice')">IService</a>
			<a href="#" onclick="go('service')">Service</a>
			<a href="#" onclick="go('tservice')">TService</a>
			<a href="#" onclick="go('api')">Api</a>
			<a href="#" onclick="go('tapi')">TApi</a>
		</span>

	</p>

	<hr />

	<iframe id="iframe" width="100%" height="800px"></iframe>

 	<script>
 	
 		var gType = 'model';
 		
 		window.onload = function() {
        	go(gType);
        }
        
        function change(){
        	go(gType);
        }
        
        function go(type){
        	gType = type;
        	
        	var tableName = document.getElementById("tableName").value;
        	var url = gType +"?tableName=" + tableName;
        	
        	document.getElementById("iframe").setAttribute("src",url);
        }
    </script>
</body>
</html>